<template>
  <div v-if="partListCon">
    <el-form ref="form" :model="partListCon" label-width="110px" size="small">
      <el-form-item label="是否显示">
        <el-switch
          class="zdySwith"
          :width="82"
          :value="partListCon.show"
          active-color="#13ce66"
          @change="updateInput($event, 'show')"
          inactive-color="#ffffff"
          active-text="显示"
          inactive-text="隐藏"
          active-value="1"
          inactive-value="0"
        ></el-switch>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import uploadpic from "@/components/page/pic/up_pic";
import LinkMenu from "@/components/currency/Link_menu.vue";
import { mapState, mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["partListConConss"]),
    ...mapState({
      active: state => state.modulePage.active,
      activeBnnerIndex: state => state.modulePage.bannerNowIndex,
      allbanner: state => state.modulePage.allbanner
    }),
    partListCon() {
      if (this.activeBnnerIndex >= 0) {
        return this.allbanner[this.activeBnnerIndex];
      } else {
        return {};
      }
    }
  },
  components: {
    uploadpic,
    LinkMenu
  },
  created() {},
  mounted() {},
  methods: {
    updateInput(val, name) {
      this.$store.commit("set_sonbanner_name", {
        key: this.activeBnnerIndex,
        name: name,
        val: val
      });
    },
  },
  watch: {}
};
</script>

<style scoped lang="less"></style>
